Description:
ULVFP detects unused local variables and formal parameters. Note that unlike C++ it is not possible to omit a formal parameter name preserving method signature. It is often the case where a method overriding a base class method must declare a parameter it does not actually need. Such situations are detected and do not produce a warning message.
Incorrect:
MyLabel = class
private
name:String;
public
function GetName(upperCase:boolean):string;
end;
...
function MyLabel.GetName(upperCase:boolean):string;
begin
result := name;
end;
Correct:
MyLabel = class
private
name:String;
public
function GetName():string;
end;
...
function MyLabel.GetName():string;
begin
result := name;
end;
Refactoring: